package com.handsome.访问者模式;

/**
 *
 * @author niechun
 * @date 2023/3/16 20:29
 */
public class Client {
    public static void main(String[] args) {
        ObjectStructure objectStructure = new ObjectStructure();

        objectStructure.attach(new Man());
        objectStructure.attach(new Woman());
        objectStructure.attach(new Woman());
        /**
         * 拓展action非常边界
         * 只需要增加一个Action的子类就行，其他部分的代码不需要修改
         */
        Action success = new Success();
        Action fail = new Fail();

        objectStructure.display(success);
        objectStructure.display(fail);


    }
}
